Optimal. Leaf size=73 \[ -\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {a^2 \cot (c+d x)}{d}+\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}-a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {2873, 3473, 8, 2611, 3770, 2607, 30} \[ -\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {a^2 \cot (c+d x)}{d}+\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}-a^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2607
Rule 2611
Rule 2873
Rule 3473
Rule 3770
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx &=\int \left (a^2 \cot ^2(c+d x)+2 a^2 \cot ^2(c+d x) \csc (c+d x)+a^2 \cot ^2(c+d x) \csc ^2(c+d x)\right ) \, dx\\ &=a^2 \int \cot ^2(c+d x) \, dx+a^2 \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx+\left (2 a^2\right ) \int \cot ^2(c+d x) \csc (c+d x) \, dx\\ &=-\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}-a^2 \int 1 \, dx-a^2 \int \csc (c+d x) \, dx+\frac {a^2 \operatorname {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=-a^2 x+\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.58, size = 140, normalized size = 1.92 \[ -\frac {a^2 \left (-8 \tan \left (\frac {1}{2} (c+d x)\right )+8 \cot \left (\frac {1}{2} (c+d x)\right )+6 \csc ^2\left (\frac {1}{2} (c+d x)\right )-6 \sec ^2\left (\frac {1}{2} (c+d x)\right )+24 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-24 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\frac {1}{2} \sin (c+d x) \csc ^4\left (\frac {1}{2} (c+d x)\right )-8 \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)+24 c+24 d x\right )}{24 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.53, size = 166, normalized size = 2.27 \[ -\frac {4 \, a^{2} \cos \left (d x + c\right )^{3} - 6 \, a^{2} \cos \left (d x + c\right ) - 3 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 6 \, {\left (a^{2} d x \cos \left (d x + c\right )^{2} - a^{2} d x - a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 141, normalized size = 1.93 \[ \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 24 \, {\left (d x + c\right )} a^{2} - 24 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {44 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.32, size = 117, normalized size = 1.60 \[ -a^{2} x -\frac {a^{2} \cot \left (d x +c \right )}{d}-\frac {a^{2} c}{d}-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )^{2}}-\frac {a^{2} \cos \left (d x +c \right )}{d}-\frac {a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.42, size = 83, normalized size = 1.14 \[ -\frac {6 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} - 3 \, a^{2} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {2 \, a^{2}}{\tan \left (d x + c\right )^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.94, size = 193, normalized size = 2.64 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}-\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {2\,a^2\,\mathrm {atan}\left (\frac {\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a^2\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {3\,a^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {3\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________